package hust.music.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import hust.music.action.base.ActionBase;
import hust.music.entity.Music;
import hust.music.entity.User;
import hust.music.service.MusicModService;

@Controller
@Scope("session")
public class MusicItemAction extends ActionBase {
	
	private static final long serialVersionUID = 1L;
	
	/** 音乐Id */
	private Integer id;
	private User user;
	private Music music;
	
	public Music getMusic() {
		return music;
	}
	public void setMusic(Music music) {
		this.music = music;
	}
	@Autowired
	MusicModService musicModService;
	public String musicItem() throws Exception{
		music = musicModService.findMusic(id);
		user = musicModService.getUploader(id);
		return SUCCESS;
	}
	public Integer getId() {
		return id;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public void setId(Integer id) {
		this.id = id;
	}
}
